import Vue from "vue";
import VueRouter from "vue-router";
import login from '@/views/login' //登录
Vue.use(VueRouter);
// 客户端 start
// 首页
import home from '@/views/home' //首页
import search from '@/views/home/search' //搜索
import vendorApply from '@/views/home/vendorApply' //商户入驻

// 卡券
import home_coupon from '@/views/coupon/home' //首页
import detail_coupon from '@/views/coupon/detail' //详情
import confirmOrder_coupon from '@/views/coupon/confirmOrder' //确认订单
import payOrder_coupon from '@/views/coupon/payOrder' //支付订单
import vendorList_coupon from '@/views/coupon/vendorList' //商户列表
import evaluate_coupon from '@/views/coupon/evaluate' //评价列表
import payResult_coupon from '@/views/coupon/payResult' //支付结果
import vipContent_coupon from '@/views/coupon/vipContent' //会员开通提示内容

// 个人中心
import home_personal from '@/views/personal/home' //我的
import aboutUs_personal from '@/views/personal/aboutUs' //关于我们
import idea_personal from '@/views/personal/idea' //意见反馈
import integralDetail_personal from '@/views/personal/integralDetail' //积分详情
import collect_personal from '@/views/personal/collect' //我的收藏
import service_personal from '@/views/personal/service' //我的客服
import redPacket_personal from '@/views/personal/redPacket' //积分红包
import coupon_personal from '@/views/personal/coupon' //优惠卷
import mySubordinate_personal from '@/views/personal/mySubordinate' //我的分销

//订单
import list_order from '@/views/order/list' //首页
import detail_order from '@/views/order/detail' //详情
import refund_order from '@/views/order/refund' //退款
import refund_detail_order from '@/views/order/refund_detail' //退款详情
import evaluation_order from '@/views/order/evaluation' //评价

//银行业务
import list_BankingBusiness from '@/views/BankingBusiness/list' //列表
import share_BankingBusiness from '@/views/BankingBusiness/share' //分享
import handle_BankingBusiness from '@/views/BankingBusiness/handle' //办理业务

//分享
import shareRegister_share from '@/views/share/shareRegister' //被分享注册
import SharingPlatform_share from '@/views/share/SharingPlatform' //分享平台
import list_share from '@/views/share/list' //分享专区

//商户
import list_vendor from '@/views/vendor/list' //首页
import offlineList_vendor from '@/views/vendor/offlineList' //到店支付商户列表
import detail_vendor from '@/views/vendor/detail' //详情
import license_vendor from '@/views/vendor/license' //详情
import evaluate_vendor from '@/views/vendor/evaluate' //评价列表
import directPayment_vendor from '@/views/vendor/directPayment' //向商家支付
import payResult_vendor from '@/views/vendor/payResult' //支付结果
// 客户端 end

// 商户端

import home_TheVendor from '@/views/TheVendor/home' //首页
import  integralList_TheVendor from '@/views/TheVendor/integralList' //积分查询
import  integralPay_TheVendor from '@/views/TheVendor/integralPay' //积分流水
import  saleList_TheVendor from '@/views/TheVendor/saleList' //销售查询
import  scanCodeRecord_TheVendor from '@/views/TheVendor/scanCodeRecord' //核销记录
import  verifier_TheVendor from '@/views/TheVendor/verifier' //核销员
import  scanCodeResult_TheVendor from '@/views/TheVendor/scanCodeResult' //核销结果
import  drawMoney_TheVendor from '@/views/TheVendor/drawMoney' //提现
import  drawMoneyList_TheVendor from '@/views/TheVendor/drawMoneyList' //提现记录
import  drawMoney_step2_TheVendor from '@/views/TheVendor/drawMoney_step2' //提现操作
import  drawMoney_step3_TheVendor from '@/views/TheVendor/drawMoney_step3' //提现结果

// 商户端 end


const routes = [
  {
    path: "/vendor/payResult",
    name: "支付成功",
    component: payResult_vendor,
  },
  {
    path: "/vendor/directPayment",
    name: "向商家支付",
    component: directPayment_vendor,
  },
  {
    path: "/TheVendor/drawMoney_step3",
    name: "提现结果",
    component: drawMoney_step3_TheVendor,
  },
  {
    path: "/TheVendor/drawMoney_step2",
    name: "提现操作",
    component: drawMoney_step2_TheVendor,
  },
  {
    path: "/TheVendor/drawMoneyList",
    name: "提现记录",
    component: drawMoneyList_TheVendor,
  },
  {
    path: "/TheVendor/drawMoney",
    name: "提现",
    component: drawMoney_TheVendor,
  },
  {
    path: "/TheVendor/scanCodeResult",
    name: "核销结果",
    component: scanCodeResult_TheVendor,
  },
  {
    path: "/TheVendor/scanCodeRecord",
    name: "核销记录",
    component: scanCodeRecord_TheVendor,
  },
  {
    path: "/TheVendor/verifier",
    name: "核销员",
    component: verifier_TheVendor,
  },
  {
    path: "/TheVendor/saleList",
    name: "销售查询",
    component: saleList_TheVendor,
  },
  {
    path: "/TheVendor/integralList",
    name: "积分查询",
    component: integralList_TheVendor,
  },
  {
    path: "/TheVendor/integralPay",
    name: "积分流水",
    component: integralPay_TheVendor,
  },
  {
    path: "/TheVendor/home",
    name: "首页",
    component: home_TheVendor,
  },
  {
    path: "/vendor/evaluate",
    name: "商户详情",
    component: evaluate_vendor,
  },
  {
    path: "/vendor/detail",
    name: "商户详情",
    component: detail_vendor,
  },
  {
    path: "/vendor/license",
    name: "营业执照",
    component: license_vendor,
  },
  {
    path: "/vendor/list",
    name: "商户中心",
    component: list_vendor,
    meta: {
      topBar: false, //顶部导航栏
      bottomTabs: true, //底部导航栏
    }
  },
  {
    path: "/vendor/offlineList",
    name: "到店支付商户列表",
    component: offlineList_vendor,
    meta: {
      topBar: true, //顶部导航栏
      bottomTabs: false, //底部导航栏
    }
  },
  {
    path: "/home/vendorApply",
    name: "商户入驻",
    component: vendorApply,
  },
  {
    path: "/personal/mySubordinate",
    name: "我的分销",
    component: mySubordinate_personal,
  },
  {
    path: "/personal/coupon",
    name: "优惠卷",
    component: coupon_personal,
  },
  {
    path: "/personal/redPacket",
    name: "积分红包",
    component: redPacket_personal,
  },
  {
    path: "/share/list",
    name: "分享专区",
    component: list_share,
  },
  {
    path: "/share/SharingPlatform",
    name: "分享平台",
    component: SharingPlatform_share,
  },
  {
    path: "/share/shareRegister",
    name: "被分享注册",
    component: shareRegister_share,
  },
  {
    path: "/personal/service",
    name: "客服",
    component: service_personal,
  },
  {
    path: "/personal/collect",
    name: "我的收藏",
    component: collect_personal,
  },
  {
    path: "/personal/integralDetail",
    name: "积分详情",
    component: integralDetail_personal,
  },
  {
    path: "/personal/idea",
    name: "意见反馈",
    component: idea_personal,
  },
  {
    path: "/personal/aboutUs",
    name: "关于我们",
    component: aboutUs_personal,
  },
  {
    path: "/coupon/vipContent",
    name: "会员开通提示内容",
    component: vipContent_coupon,
  },
  {
    path: "/coupon/payResult",
    name: "支付结果",
    component: payResult_coupon,
  },
  {
    path: "/coupon/evaluate",
    name: "评价列表",
    component: evaluate_coupon,
  },
  {
    path: "/coupon/vendorList",
    name: "商户列表",
    component: vendorList_coupon,
  },
  {
    path: "/BankingBusiness/handle",
    name: "办理业务",
    component: handle_BankingBusiness,
  },
  {
    path: "/BankingBusiness/share",
    name: "银行业务分享",
    component: share_BankingBusiness,
  },
  {
    path: "/BankingBusiness/list",
    name: "银行业务",
    component: list_BankingBusiness,
  },

  {
    path: "/coupon/evaluation",
    name: "发表评价",
    component: evaluation_order,
  },

  {
    path: "/coupon/payOrder",
    name: "支付订单",
    component: payOrder_coupon,
  },
  {
    path: "/coupon/confirmOrder",
    name: "确认订单",
    component: confirmOrder_coupon,
  },
  {
    path: "/order/refund_detail",
    name: "订单退款详情",
    component: refund_detail_order,
  },
  {
    path: "/order/refund",
    name: "订单退款",
    component: refund_order,
  },

  {
    path: "/order/detail",
    name: "订单详情",
    component: detail_order,
  },

  {
    path: "/order/list",
    name: "订单列表",
    component: list_order,
  },
  {
    path: "/personal/home",
    name: "我的",
    component: home_personal,
    meta: {
      topBar: false, //顶部导航栏
      bottomTabs: true, //底部导航栏
    }
  },
  {
    path: "/coupon/detail",
    name: "卡卷详情",
    component: detail_coupon,
    meta: {}
  },
  {
    path: "/coupon/home",
    name: "卡卷中心",
    component: home_coupon,
    meta: {
      topBar: false, //顶部导航栏
      bottomTabs: true, //底部导航栏
    }
  },
  {
    path: "/home/search",
    name: "搜索",
    component: search,
    meta: {
      bottomTabs: false, //底部导航栏
    }
  },
  {
    path: "/home",
    name: "首页",
    component: home,
    meta: {
      topBar: false, //顶部导航栏
      bottomTabs: true, //底部导航栏
    }
  },
  {
    path: "/",
    name: "WaWa搭子",
    component: login,
    meta: {
      topBar: false, //顶部导航栏
    }
  },


];

const router = new VueRouter({
  mode: "history",
  base: '/',
  scrollBehavior(to, from, savedPosition) { //跳转路由置顶
    if (savedPosition) {
      return savedPosition
    } else {
      return {
        x: 0,
        y: 0
      }
    }
  },
  routes
});

export default router;